\hypertarget{a00063}{}\section{E\+:/knet-\/git/knet/knet/framework\+\_\+raiser.c 文件参考}
\label{a00063}\index{E\+:/knet-\/git/knet/knet/framework\+\_\+raiser.\+c@{E\+:/knet-\/git/knet/knet/framework\+\_\+raiser.\+c}}
{\ttfamily \#include \char`\"{}framework\+\_\+raiser.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}loop.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}loop\+\_\+balancer.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}framework.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}channel\+\_\+ref.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}framework\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}list.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}misc.\+h\char`\"{}}\\*
\subsection*{结构体}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{a00012}{\+\_\+framework\+\_\+raiser\+\_\+t}
\end{DoxyCompactItemize}
\subsection*{函数}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{a00063_a91c61ccfc179459b2c2e915960f760c5_a91c61ccfc179459b2c2e915960f760c5}{\+\_\+create\+\_\+acceptor\+\_\+channel} (\hyperlink{a00056_a39c993eb450173e4fde04498d757f9b6_a39c993eb450173e4fde04498d757f9b6}{kframework\+\_\+acceptor\+\_\+config\+\_\+t} $\ast$ac, \hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop)
\begin{DoxyCompactList}\small\item\em 创建监听器 \end{DoxyCompactList}\item 
int \hyperlink{a00063_ad7c7b843bae2a690ffeee728f0da2116_ad7c7b843bae2a690ffeee728f0da2116}{\+\_\+create\+\_\+connector\+\_\+channel} (\hyperlink{a00056_a44d3033eba5a4fd784a741700a7a2521_a44d3033eba5a4fd784a741700a7a2521}{kframework\+\_\+connector\+\_\+config\+\_\+t} $\ast$cc, \hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop)
\begin{DoxyCompactList}\small\item\em 创建连接器 \end{DoxyCompactList}\item 
\hyperlink{a00056_af10637001508cbbf3a84f95c71318532_af10637001508cbbf3a84f95c71318532}{kframework\+\_\+raiser\+\_\+t} $\ast$ \hyperlink{a00063_a2b6bd6bd9b9c60ab24eab0c0700bc855_a2b6bd6bd9b9c60ab24eab0c0700bc855}{knet\+\_\+framework\+\_\+raiser\+\_\+create} (\hyperlink{a00056_a3195a3be35782fc1efb920c811be111d_a3195a3be35782fc1efb920c811be111d}{kframework\+\_\+t} $\ast$f, \hyperlink{a00056_a97fc76209a58362019f1ded9169e397f_a97fc76209a58362019f1ded9169e397f}{kloop\+\_\+t} $\ast$loop)
\begin{DoxyCompactList}\small\item\em 建立网络连接发起者(监听器/连接器) \end{DoxyCompactList}\item 
void \hyperlink{a00063_abafbab78ce889f71a99d7200977507a2_abafbab78ce889f71a99d7200977507a2}{knet\+\_\+framework\+\_\+raiser\+\_\+destroy} (\hyperlink{a00056_af10637001508cbbf3a84f95c71318532_af10637001508cbbf3a84f95c71318532}{kframework\+\_\+raiser\+\_\+t} $\ast$raiser)
\begin{DoxyCompactList}\small\item\em 销毁网络连接发起者 \end{DoxyCompactList}\item 
int \hyperlink{a00063_ad6b3a3a742cf17b521c85962b693efc5_ad6b3a3a742cf17b521c85962b693efc5}{knet\+\_\+framework\+\_\+raiser\+\_\+start} (\hyperlink{a00056_af10637001508cbbf3a84f95c71318532_af10637001508cbbf3a84f95c71318532}{kframework\+\_\+raiser\+\_\+t} $\ast$raiser)
\begin{DoxyCompactList}\small\item\em 启动网络连接发起者 \end{DoxyCompactList}\item 
void \hyperlink{a00063_a6e9cfd9d165129b0099e929885aa78e5_a6e9cfd9d165129b0099e929885aa78e5}{knet\+\_\+framework\+\_\+raiser\+\_\+stop} (\hyperlink{a00056_af10637001508cbbf3a84f95c71318532_af10637001508cbbf3a84f95c71318532}{kframework\+\_\+raiser\+\_\+t} $\ast$raiser)
\begin{DoxyCompactList}\small\item\em 关闭网络连接发起者 \end{DoxyCompactList}\item 
void \hyperlink{a00063_afcada6a8c7bb6d0d91c55df37352f5fb_afcada6a8c7bb6d0d91c55df37352f5fb}{knet\+\_\+framework\+\_\+raiser\+\_\+wait\+\_\+for\+\_\+stop} (\hyperlink{a00056_af10637001508cbbf3a84f95c71318532_af10637001508cbbf3a84f95c71318532}{kframework\+\_\+raiser\+\_\+t} $\ast$raiser)
\begin{DoxyCompactList}\small\item\em 等待网络连接发起者 \end{DoxyCompactList}\item 
int \hyperlink{a00063_a1fa517b4b3e577a30f12f5b77dfaa9a3_a1fa517b4b3e577a30f12f5b77dfaa9a3}{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+acceptor} (\hyperlink{a00056_af10637001508cbbf3a84f95c71318532_af10637001508cbbf3a84f95c71318532}{kframework\+\_\+raiser\+\_\+t} $\ast$raiser, \hyperlink{a00056_a39c993eb450173e4fde04498d757f9b6_a39c993eb450173e4fde04498d757f9b6}{kframework\+\_\+acceptor\+\_\+config\+\_\+t} $\ast$c)
\begin{DoxyCompactList}\small\item\em 启动一个新的监听器 \end{DoxyCompactList}\item 
int \hyperlink{a00063_af58dbe8c5764d42ecb712d4a93391d11_af58dbe8c5764d42ecb712d4a93391d11}{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+connector} (\hyperlink{a00056_af10637001508cbbf3a84f95c71318532_af10637001508cbbf3a84f95c71318532}{kframework\+\_\+raiser\+\_\+t} $\ast$raiser, \hyperlink{a00056_a44d3033eba5a4fd784a741700a7a2521_a44d3033eba5a4fd784a741700a7a2521}{kframework\+\_\+connector\+\_\+config\+\_\+t} $\ast$c)
\begin{DoxyCompactList}\small\item\em 启动一个新的连接器 \end{DoxyCompactList}\item 
void \hyperlink{a00063_ac31f510b72c39d3b0611b9500789577b_ac31f510b72c39d3b0611b9500789577b}{acceptor\+\_\+cb} (\hyperlink{a00056_a3b7e82599367eade261456f60ebe2cd9_a3b7e82599367eade261456f60ebe2cd9}{kchannel\+\_\+ref\+\_\+t} $\ast$channel, \hyperlink{a00056_a2fd2faf971268f5b682ab375c455f7c9_a2fd2faf971268f5b682ab375c455f7c9}{knet\+\_\+channel\+\_\+cb\+\_\+event\+\_\+e} e)
\begin{DoxyCompactList}\small\item\em 事件channel\+\_\+cb\+\_\+event\+\_\+accept处理函数 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{函数说明}
\hypertarget{a00063_a91c61ccfc179459b2c2e915960f760c5_a91c61ccfc179459b2c2e915960f760c5}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!\+\_\+create\+\_\+acceptor\+\_\+channel@{\+\_\+create\+\_\+acceptor\+\_\+channel}}
\index{\+\_\+create\+\_\+acceptor\+\_\+channel@{\+\_\+create\+\_\+acceptor\+\_\+channel}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{\+\_\+create\+\_\+acceptor\+\_\+channel}]{\setlength{\rightskip}{0pt plus 5cm}int \+\_\+create\+\_\+acceptor\+\_\+channel (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+acceptor\+\_\+config\+\_\+t} $\ast$}]{ac, }
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop}
\end{DoxyParamCaption}
)}\label{a00063_a91c61ccfc179459b2c2e915960f760c5_a91c61ccfc179459b2c2e915960f760c5}


创建监听器 

\hypertarget{a00063_ad7c7b843bae2a690ffeee728f0da2116_ad7c7b843bae2a690ffeee728f0da2116}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!\+\_\+create\+\_\+connector\+\_\+channel@{\+\_\+create\+\_\+connector\+\_\+channel}}
\index{\+\_\+create\+\_\+connector\+\_\+channel@{\+\_\+create\+\_\+connector\+\_\+channel}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{\+\_\+create\+\_\+connector\+\_\+channel}]{\setlength{\rightskip}{0pt plus 5cm}int \+\_\+create\+\_\+connector\+\_\+channel (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+connector\+\_\+config\+\_\+t} $\ast$}]{cc, }
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop}
\end{DoxyParamCaption}
)}\label{a00063_ad7c7b843bae2a690ffeee728f0da2116_ad7c7b843bae2a690ffeee728f0da2116}


创建连接器 

\hypertarget{a00063_ac31f510b72c39d3b0611b9500789577b_ac31f510b72c39d3b0611b9500789577b}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!acceptor\+\_\+cb@{acceptor\+\_\+cb}}
\index{acceptor\+\_\+cb@{acceptor\+\_\+cb}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{acceptor\+\_\+cb}]{\setlength{\rightskip}{0pt plus 5cm}void acceptor\+\_\+cb (
\begin{DoxyParamCaption}
\item[{{\bf kchannel\+\_\+ref\+\_\+t} $\ast$}]{channel, }
\item[{{\bf knet\+\_\+channel\+\_\+cb\+\_\+event\+\_\+e}}]{e}
\end{DoxyParamCaption}
)}\label{a00063_ac31f510b72c39d3b0611b9500789577b_ac31f510b72c39d3b0611b9500789577b}


事件channel\+\_\+cb\+\_\+event\+\_\+accept处理函数 


\begin{DoxyParams}{参数}
{\em channel} & 监听管道，kchannel\+\_\+ref\+\_\+t实例 \\
\hline
{\em e} & 管道事件 \\
\hline
\end{DoxyParams}
\hypertarget{a00063_a2b6bd6bd9b9c60ab24eab0c0700bc855_a2b6bd6bd9b9c60ab24eab0c0700bc855}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!knet\+\_\+framework\+\_\+raiser\+\_\+create@{knet\+\_\+framework\+\_\+raiser\+\_\+create}}
\index{knet\+\_\+framework\+\_\+raiser\+\_\+create@{knet\+\_\+framework\+\_\+raiser\+\_\+create}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{knet\+\_\+framework\+\_\+raiser\+\_\+create}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kframework\+\_\+raiser\+\_\+t}$\ast$ knet\+\_\+framework\+\_\+raiser\+\_\+create (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+t} $\ast$}]{f, }
\item[{{\bf kloop\+\_\+t} $\ast$}]{loop}
\end{DoxyParamCaption}
)}\label{a00063_a2b6bd6bd9b9c60ab24eab0c0700bc855_a2b6bd6bd9b9c60ab24eab0c0700bc855}


建立网络连接发起者(监听器/连接器) 


\begin{DoxyParams}{参数}
{\em f} & kframework\+\_\+t实例 \\
\hline
{\em loop} & kloop\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kframework\+\_\+raiser\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00063_abafbab78ce889f71a99d7200977507a2_abafbab78ce889f71a99d7200977507a2}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!knet\+\_\+framework\+\_\+raiser\+\_\+destroy@{knet\+\_\+framework\+\_\+raiser\+\_\+destroy}}
\index{knet\+\_\+framework\+\_\+raiser\+\_\+destroy@{knet\+\_\+framework\+\_\+raiser\+\_\+destroy}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{knet\+\_\+framework\+\_\+raiser\+\_\+destroy}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+framework\+\_\+raiser\+\_\+destroy (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+raiser\+\_\+t} $\ast$}]{raiser}
\end{DoxyParamCaption}
)}\label{a00063_abafbab78ce889f71a99d7200977507a2_abafbab78ce889f71a99d7200977507a2}


销毁网络连接发起者 


\begin{DoxyParams}{参数}
{\em raiser} & kframework\+\_\+raiser\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00063_a1fa517b4b3e577a30f12f5b77dfaa9a3_a1fa517b4b3e577a30f12f5b77dfaa9a3}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+acceptor@{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+acceptor}}
\index{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+acceptor@{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+acceptor}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+acceptor}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+acceptor (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+raiser\+\_\+t} $\ast$}]{raiser, }
\item[{{\bf kframework\+\_\+acceptor\+\_\+config\+\_\+t} $\ast$}]{c}
\end{DoxyParamCaption}
)}\label{a00063_a1fa517b4b3e577a30f12f5b77dfaa9a3_a1fa517b4b3e577a30f12f5b77dfaa9a3}


启动一个新的监听器 


\begin{DoxyParams}{参数}
{\em raiser} & kframework\+\_\+raiser\+\_\+t实例 \\
\hline
{\em c} & kframework\+\_\+acceptor\+\_\+config\+\_\+t实例 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em error\+\_\+ok} & 成功 \\
\hline
{\em 其他} & 失败 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00063_af58dbe8c5764d42ecb712d4a93391d11_af58dbe8c5764d42ecb712d4a93391d11}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+connector@{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+connector}}
\index{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+connector@{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+connector}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+connector}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+framework\+\_\+raiser\+\_\+new\+\_\+connector (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+raiser\+\_\+t} $\ast$}]{raiser, }
\item[{{\bf kframework\+\_\+connector\+\_\+config\+\_\+t} $\ast$}]{c}
\end{DoxyParamCaption}
)}\label{a00063_af58dbe8c5764d42ecb712d4a93391d11_af58dbe8c5764d42ecb712d4a93391d11}


启动一个新的连接器 


\begin{DoxyParams}{参数}
{\em raiser} & kframework\+\_\+raiser\+\_\+t实例 \\
\hline
{\em c} & kframework\+\_\+connector\+\_\+config\+\_\+t实例 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em error\+\_\+ok} & 成功 \\
\hline
{\em 其他} & 失败 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00063_ad6b3a3a742cf17b521c85962b693efc5_ad6b3a3a742cf17b521c85962b693efc5}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!knet\+\_\+framework\+\_\+raiser\+\_\+start@{knet\+\_\+framework\+\_\+raiser\+\_\+start}}
\index{knet\+\_\+framework\+\_\+raiser\+\_\+start@{knet\+\_\+framework\+\_\+raiser\+\_\+start}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{knet\+\_\+framework\+\_\+raiser\+\_\+start}]{\setlength{\rightskip}{0pt plus 5cm}int knet\+\_\+framework\+\_\+raiser\+\_\+start (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+raiser\+\_\+t} $\ast$}]{raiser}
\end{DoxyParamCaption}
)}\label{a00063_ad6b3a3a742cf17b521c85962b693efc5_ad6b3a3a742cf17b521c85962b693efc5}


启动网络连接发起者 


\begin{DoxyParams}{参数}
{\em raiser} & kframework\+\_\+raiser\+\_\+t实例 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em error\+\_\+ok} & 成功 \\
\hline
{\em 其他} & 失败 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00063_a6e9cfd9d165129b0099e929885aa78e5_a6e9cfd9d165129b0099e929885aa78e5}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!knet\+\_\+framework\+\_\+raiser\+\_\+stop@{knet\+\_\+framework\+\_\+raiser\+\_\+stop}}
\index{knet\+\_\+framework\+\_\+raiser\+\_\+stop@{knet\+\_\+framework\+\_\+raiser\+\_\+stop}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{knet\+\_\+framework\+\_\+raiser\+\_\+stop}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+framework\+\_\+raiser\+\_\+stop (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+raiser\+\_\+t} $\ast$}]{raiser}
\end{DoxyParamCaption}
)}\label{a00063_a6e9cfd9d165129b0099e929885aa78e5_a6e9cfd9d165129b0099e929885aa78e5}


关闭网络连接发起者 


\begin{DoxyParams}{参数}
{\em raiser} & kframework\+\_\+raiser\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00063_afcada6a8c7bb6d0d91c55df37352f5fb_afcada6a8c7bb6d0d91c55df37352f5fb}{}\index{framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}!knet\+\_\+framework\+\_\+raiser\+\_\+wait\+\_\+for\+\_\+stop@{knet\+\_\+framework\+\_\+raiser\+\_\+wait\+\_\+for\+\_\+stop}}
\index{knet\+\_\+framework\+\_\+raiser\+\_\+wait\+\_\+for\+\_\+stop@{knet\+\_\+framework\+\_\+raiser\+\_\+wait\+\_\+for\+\_\+stop}!framework\+\_\+raiser.\+c@{framework\+\_\+raiser.\+c}}
\subsubsection[{knet\+\_\+framework\+\_\+raiser\+\_\+wait\+\_\+for\+\_\+stop}]{\setlength{\rightskip}{0pt plus 5cm}void knet\+\_\+framework\+\_\+raiser\+\_\+wait\+\_\+for\+\_\+stop (
\begin{DoxyParamCaption}
\item[{{\bf kframework\+\_\+raiser\+\_\+t} $\ast$}]{raiser}
\end{DoxyParamCaption}
)}\label{a00063_afcada6a8c7bb6d0d91c55df37352f5fb_afcada6a8c7bb6d0d91c55df37352f5fb}


等待网络连接发起者 


\begin{DoxyParams}{参数}
{\em raiser} & kframework\+\_\+raiser\+\_\+t实例 \\
\hline
\end{DoxyParams}
